<?php
$config = [
    'version' => \common\config\Env::$version,
    'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
    'language' => 'zh-CN',
    'timeZone' => 'Asia/Shanghai',
    'aliases' => [
        '@bower' => '@vendor/bower',
        '@npm' => '@vendor/npm',
    ],
    'bootstrap' => ['log', 'cache'],
    'components' => [
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => \yii\log\DbTarget::class,
                    'levels' => ['error'],
                ],
            ],
        ],
        'monolog' => [ // Yii::$app->monolog->getLogger('main')->log('info', 'Hello world');
            'class' => '\Mero\Monolog\MonologComponent',
            'channels' => [
                'main' => [
                    'handler' => [
                        [
                            'type' => 'stream',
                            'path' => '@app/runtime/logs/main_' . date('Y-m-d') . '.log',
                            'level' => 'debug'
                        ]
                    ],
                    'processor' => [],
                ],
                'yiichina_sign' => [
                    'handler' => [
                        [
                            'type' => 'stream',
                            'path' => '@app/runtime/logs/yiichina_sign_' . date('Y-m-d') . '.log',
                            'level' => 'debug'
                        ]
                    ],
                ],
                'channel2' => [
                    'handler' => [
                        [
                            'type' => 'stream',
                            'path' => '@app/runtime/logs/channel1_' . date('Y-m-d') . '.log',
                            'level' => 'debug'
                        ]
                    ],
                ],
            ],
        ],
        'cache' => [
            'class' => \yii\caching\FileCache::class,
        ],
        'timer'  => [
            'class' => \common\members\wodrow\components\timer\Timer::class,
            'saveLog' => true,         //开启文件保存
            'logFileName'=>'timer-log.txt'   //保存的文件名(位置:runtime文件夹下,）
            //如果未设置则保存到YII日志记录中
        ],
        'backup' => [
            'class' => 'demi\backup\Component',
            // The directory for storing backups files
            'backupsFolder' => Yii::getAlias(\common\config\Env::$demi_backup_folder), // <project-root>/backups
            // Directories that will be added to backup
            'directories' => [
                'uploads' => '@storage_root/uploads',
            ],
        ],
        'i18n' => [
            'translations' => [
                'insolita/iconpicker' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@common/messages',
//                    'sourceLanguage' => 'en'
                ]
            ]
        ],
    ],
    'params' => [
        'icon-framework' => 'fa',
    ],
];

return $config;